home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-21 | 2.1 KB | 68 lines | [TEXT/MPS ] |
- // The C++ Booch Components (Version 2.1)
- // (C) Copyright 1990-1993 Grady Booch. All Rights Reserved.
- //
- // BCMapU.h
- //
- // This file contains the declaration of the unbounded map.
-
- #ifndef BCMAPU_H
- #define BCMAPU_H 1
-
- #include "BCNodes.h"
- #include "BCUnboun.h"
- #include "BCHashTa.h"
- #include "BCMap.h"
-
- // Unbounded map
-
- template<class Item, class Value, BC_Index Buckets, class StorageManager>
- class BC_TUnboundedMap : public BC_TMap<Item, Value> {
- public:
-
- BC_TUnboundedMap();
- BC_TUnboundedMap(BC_Index (*)(const Item&));
- BC_TUnboundedMap(const BC_TUnboundedMap<Item, Value, Buckets, StorageManager>&);
- virtual ~BC_TUnboundedMap();
-
- virtual BC_TMap<Item, Value>& operator=(const BC_TMap<Item, Value>&);
- virtual BC_TMap<Item, Value>&
- operator=(const BC_TUnboundedMap<Item, Value, Buckets, StorageManager>&);
- virtual BC_Boolean operator==(const BC_TMap<Item, Value>&) const;
- virtual BC_Boolean
- operator==(const BC_TUnboundedMap<Item, Value, Buckets, StorageManager>&) const;
- BC_Boolean
- operator!=(const BC_TUnboundedMap<Item, Value, Buckets, StorageManager>&) const;
-
- virtual void SetHashFunction(BC_Index (*)(const Item&));
- virtual void Clear();
- virtual BC_Boolean Bind(const Item&, const Value&);
- virtual BC_Boolean Rebind(const Item&, const Value&);
- virtual BC_Boolean Unbind(const Item&);
-
- virtual BC_Index Extent() const;
- virtual BC_Boolean IsEmpty() const;
- virtual BC_Boolean IsBound(const Item&) const;
- virtual const Value* ValueOf(const Item&) const;
- virtual Value* ValueOf(const Item&);
-
- static void* operator new(size_t);
- static void operator delete(void*, size_t);
-
- protected:
-
- BC_TTable<Item, Value, Buckets, BC_TUnbounded<BC_TPair<Item, Value>, StorageManager> >
- fRep;
-
- virtual void Purge();
- virtual BC_Boolean Attach(const Item&, const Value&);
- virtual BC_Index Cardinality() const;
- virtual BC_Index NumberOfBuckets() const;
- virtual BC_Index Length(BC_Index bucket) const;
- virtual BC_Boolean Exists(const Item&) const;
- virtual const Item& ItemAt(BC_Index bucket, BC_Index index) const;
- virtual const Value& ValueAt(BC_Index bucket, BC_Index index) const;
-
- };
-
- #endif
-